feat(seo): add robots.txt#118
Conversation
Every public page now emits Open Graph and Twitter card tags (title, description, url, image) so links render branded previews on LinkedIn, Slack, WhatsApp and X. - Add a branded 1200x630 social card generated with next/og, served site-wide via app/opengraph-image and reused for app/twitter-image. - Add buildMetadata() helper that produces matching title/description/ canonical plus OG and Twitter card objects for each page. - Route home and auth pages through the helper; add OG/Twitter defaults to the root layout for inheritance. Refs #106
Footer links now resolve to real pages or anchors instead of placeholders that fell back to the homepage, and the previously missing contact and legal pages exist. - Footer: grouped Product/Company/Legal navigation with a real contact email, on-page anchors (#how-it-works, #faq), the parent company site, and links to the new pages. - Add /contact (indexable) with a real, monitored address. - Add /privacy and /terms minimal legal pages (noindex,follow). - Add SitePage shell for consistent standalone-page layout. Refs #112
Serve a robots.txt that allows public pages, blocks the API and gated admin/user areas, and points crawlers to the sitemap. Refs #107
|
Claude finished @prudentbird's task —— View job PR Review: feat(seo): add robots.txtReviewing this PR for code quality, best practices, potential bugs, performance considerations, security concerns, and test coverage. Todo List:
🟢 Overall AssessmentThis is a well-implemented robots.txt solution that follows Next.js App Router conventions correctly. The code is clean, follows TypeScript best practices, and addresses the SEO requirements effectively. ✅ StrengthsCode Quality & Best Practices:
SEO Implementation:
🟡 Minor ConsiderationsSecurity & Best Practices:
Performance:
Code Robustness:
🔍 Testing ConsiderationsCurrent State: No dedicated tests for robots.txt generation // Potential test structure (if testing is added later)
describe('robots.txt', () => {
it('should block sensitive routes', () => {
const robots = robotsFunction();
expect(robots.rules.disallow).toContain('/api/');
});
});However, since this is a simple metadata route with no complex logic, the validation mentioned in the PR description ( 🎯 Recommendations
📝 Code-Specific Feedback
✨ Final VerdictApprove - This PR is ready for merge. The implementation is solid, follows Next.js best practices, and effectively addresses the SEO requirements. The strategic decisions around crawlability are well-reasoned and documented. The code quality is high, security considerations are properly addressed, and the performance impact is minimal. No blocking issues identified. |
Summary
Adds a generated
robots.txt(src/app/robots.ts) so crawlers get explicit guidance./api/,/admin, and/user(gated/authenticated areas) to save crawl budget.https://retailytics.ajared.ng/sitemap.xml(added in the next PR, feat(seo): add sitemap.xml #108).Auth pages (
/login,/register,/forgot-password) are intentionally left crawlable so theirnoindex,followmeta is honored.Done when (issue #107)
robots.txtis served, allows public pages, blocks API and gated/authenticated routes, and points to the sitemap.Validation
npm run typecheck✅npm run build✅ —/robots.txtroute generated.Notes
Stacked on #112 (targets
feat/seo-112-footer-legal-pages).Closes #107